
package controllers

import (
	"beego_blog/services"
)

type TeacherController struct {
	baseController
	service services.TeacherService
}

func (c *TeacherController) Add() {
	if c.Ctx.Request.Method == "POST" {
		c.SuccessJson(c.service.Add(c.Input()))
	}
}

func (c *TeacherController) Delete() {
	if c.Ctx.Request.Method == "POST" {
		c.SuccessJson(c.service.Delete(c.Input()))
	}
}

func (c *TeacherController) Query() {
	if c.Ctx.Request.Method == "POST" {
		c.SuccessJson(c.service.Query(c.Input()))
	}
}

func (c *TeacherController) QueryByPk() {
	if c.Ctx.Request.Method == "POST" {
		c.SuccessJson(c.service.QueryByPk(c.Input()))
	}
}

func (c *TeacherController) Update() {
	if c.Ctx.Request.Method == "POST" {
		c.SuccessJson(c.service.Update(c.Input()))
	}
}

func (c *TeacherController) Prepare() {
	c.baseController.Prepare()
	c.service = services.TeacherService{}
	c.service.Prepare()
}
	
